#pragma once

extern "C"
{
  #include <libavcodec/avcodec.h>
  #include <libavformat/avformat.h>
}

#include <string>
#include "constructormagic.h"

using std::string;

class AudioReader{
public:
    AudioReader() = default;
    int Init(string filename);
    ~AudioReader();

    int GetPacket(uint8_t* pBuf, int* pSize);

private:
  AVFormatContext* _pFormatCtx = nullptr;
  int             _audioStream = -1;
  AVCodecContext* _pCodecCtx = nullptr;
  string          _filename;

  RTC_DISALLOW_COPY_AND_ASSIGN(AudioReader);
};